﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace BusinessLogic
{
    public class BizCity
    {
        #region properties
        public int id { get; set; }
        public string name { get; set; }
        public double latitude { get; set; }
        public double longitude { get; set; }
        public double north_east_lat { get; set; }
        public double north_east_lng { get; set; }
        public double south_west_lat { get; set; }
        public double south_west_lng { get; set; }
        #endregion

        #region constructors
        public BizCity(int id, string name) 
        {
            this.id = id;
            this.name = name;
        }

        public BizCity(int id, string name, double latitude, double longitude, double north_east_lat, double north_east_lng, double south_west_lat, double south_west_lng)
        {
            this.id = id;
            this.name = name;
            this.latitude = latitude;
            this.longitude = longitude;
            this.north_east_lat = north_east_lat;
            this.north_east_lng = north_east_lng;
            this.south_west_lat = south_west_lat;
            this.south_west_lng = south_west_lng;
        }
        #endregion

        #region methods
        public static List<BizCity> getAll() //get all cities
        {
            return DataAccess.DalCity.getAll();
        }

        public static BizCity getCitybyId(int id) //get city by id
        {
            return DataAccess.DalCity.getCitybyId(id);
        }

        public static List<BizPlace> getPlaceinCity(int cityId)
        {
            return DataAccess.DalCity.getPlaceinCity(cityId);
        }
        #endregion
    }
}